package abg.core.service.jldz;

import abg.core.domain.db.AaFile;
import abg.core.domain.db.AaTask;
import abg.core.domain.db.AaXqCj;
import abg.core.domain.search.*;
import com.mybatisflex.core.paginate.Page;
import com.mybatisflex.core.query.QueryWrapper;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;
import java.util.ArrayList;

public interface JldzService {

    Object ddUpload();

    Page<AaXqCj> teacherCourse(TCoursePsh pageSearch);

    Page<AaFile> teacherCourseFile(TCourseFilePsh pageSearch);

    Page<AaTask> teacherTask(TTaskPsh pageSearch);

    /**
     * 上传文件
     *
     * @param file     文件
     * @param token    身份Token
     * @param taskType 任务类型
     * @param taskId   任务ID
     * @param cjNumber 活动编号
     */
    AaFile uploadAnyFile(MultipartFile file, String token, String taskType, String taskId, String cjNumber) throws IOException;

    //上传文件
    boolean deleteFile(String ids);

    //教务处任务分页查询
    Page<AaTask> jwPageTask(JwTaskPsh pageSearch);

    //教务处添加任务
    boolean jwAddTask(AaTask param);

    //教务处关闭任务
    boolean updateTaskStatus(String ids, String isOpen);

    //教务处删除任务
    boolean jwDelTask(String ids);

    //修改任务信息
    boolean jwUpdateTask(AaTask param);

    void downloadZip(String paths, String zipName) throws Exception;

    //初始化用户
    void initUserAccount();

    Page taskFile(TCourseFilePsh pageSearch);

    void jwDownloadZip(String taskIds, String cjNumbers, String type, QueryWrapper wrapper) throws Exception;

    void jwDownloadJsZip(String cjNumbers, String type, QueryWrapper wrapper) throws Exception;

    String getBmCode();

    String getJsNumber();

    /**
     * 生成教师文件压缩包
     *
     * @param bmCode
     * @param createUserType 生成人身份；部门0；教务处1；
     * @param zipType
     * @param zipName
     * @param cjNumberList
     */
    boolean createJsZip(String bmCode, String createUserType, String zipType, String zipName, ArrayList<String> cjNumberList);

    /**
     * 生成任务压缩包
     *
     * @param zipType
     * @param zipName
     * @param taskIdList
     */
    boolean createTaskZip(String zipType, String createUserType, String zipName, String taskType, ArrayList<String> taskIdList);

    Page pageZip(ZipPsh pageSearch);

    void jwDeleteZipFile(String ids);

    void bmDeleteZipFile(String ids);
}
